import request from '@/utils/request'

export function getP2PList() {
  return request({
    url: '/inform/p2p/list',
    method: 'get'
  })
}
export function getUnReadList(params) {
  return request({
    url: '/inform/unRead/list',
    method: 'get',
    params
  })
}

export function getP2OList() {
  return request({
    url: '/inform/p2o/list',
    method: 'get'
  })
}
export function getHistory(params) {
  return request({
    url: '/inform/group/history',
    method: 'get',
    params: params
  })
}

export function sendP2PMessage(data) {
  return request({
    url: '/inform/p2p/group/send',
    method: 'post',
    data
  })
}

export function getGroupInfoByName(name) {
  return request({
    url: '/inform/group/info',
    method: 'get',
    params: { name }
  })
}
export function getAllGroupByUid(id) {
  return request({
    url: '/inform/group/all',
    method: 'get',
    params: { id }
  })
}
export function checkP2OAuth(oid) {
  return request({
    url: '/inform/group/p2o/check',
    method: 'get',
    params: { oid }
  })
}

